package com.zto.demo.gateway;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.zto.demo.vo.TestUser;
import com.zto.gateway.annotation.RpcConfig;
import com.zto.gateway.annotation.RpcParam;
import com.zto.gateway.annotation.RpcService;
import com.zto.gateway.define.ParamName;
import com.zto.gateway.define.SerializeType;
 
/**
 * Created by yewenlin on 2016-10-13.
 */
@Service
@RpcService(group = "demoService")
public class DemoService {
	
	//private static final Logger log = Logger.getLogger(DemoService.class.getName());
	private static final Logger log = LoggerFactory.getLogger(DemoService.class);
	
    /**
     * @param companyId
     * @param testUser
     * @return
     */
    @RpcConfig(name = "create", responseType = SerializeType.PRIMITIVE)
    public String service(@RpcParam(name = ParamName.COMPANY_ID) String companyId,
                                @RpcParam(name = ParamName.DATA, requestType = SerializeType.JSON) TestUser testUser) {
    	this.log.info("{} name:"+testUser.getName(),new Date());
        return "这里是返回值： name="+testUser.getName();
    }
}